package com.ch999.detect.View.dialog;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.ch999.detect.R;
import com.ch999.detect.View.SelectStartDialog;


/**
 * Created by Administrator on 2016/12/13 0013.
 */

public class WifiUnOpenDialog extends SelectStartDialog {

    View.OnClickListener listener;
    private TextView mTvTitle;

    public WifiUnOpenDialog(Context context, View.OnClickListener listener) {
        super(context);
        this.listener = listener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_not_prim_layout);
        mTvTitle = (TextView) findViewById(R.id.tv_title);
        mTvTitle.setText("请打开手机wifi");
        setCanceledOnTouchOutside(false);
        Button btnNormal = (Button) findViewById(R.id.btn_normal);
        btnNormal.setText("设置wifi");
        btnNormal.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
                if (listener != null) {
                    listener.onClick(view);
                }
            }
        });

    }


    public void show(String titleString) {
        super.show();
        if (!TextUtils.isEmpty(titleString)) {

            mTvTitle.setText(titleString);
        }

    }


}
